//
// Created by Administrator on 2024/8/19.
//

#ifndef MESSAGE_BODY_FACTORY_H
#define MESSAGE_BODY_FACTORY_H
#include "../jtt809_body.h"
#include "../util/constants.h"
#include "bodies_pch.h"

namespace protocol {
    class MessageBodyFactory {
    public:
        static JTT809Body *createBody(JTT809Bodies type) {
            JTT809Body *body = nullptr;
            switch (type) {
                case JTT809Bodies::UP_CONNECT_REQ: {
                    body = new JTT809_0x1001;
                    break;
                }
                case JTT809Bodies::UP_CONNECT_RSP: {
                    body = new JTT809_0x1002;
                    break;
                }
                case JTT809Bodies::UP_DISCONNECT_REQ: {
                    body = new JTT809_0x1003;
                    break;
                }
                case JTT809Bodies::UP_DISCONNECT_RSP: {
                    body = new JTT809_0x1004;
                    break;
                }
                case JTT809Bodies::UP_LINKTEST_REQ: {
                    body = new JTT809_0x1005;
                    break;
                }
                case JTT809Bodies::UP_LINKTEST_RSP: {
                    body = new JTT809_0x1006;
                    break;
                }
                case JTT809Bodies::UP_DISCONNECT_INFORM: {
                    body = new JTT809_0x1007;
                    break;
                }
                case JTT809Bodies::UP_CLOSELINK_INFORM: {
                    body = new JTT809_0x1008;
                    break;
                }
                case JTT809Bodies::DOWN_CONNECT_REQ: {
                    body = new JTT809_0x9001;
                    break;
                }
                case JTT809Bodies::DOWN_CONNECT_RSP: {
                    body = new JTT809_0x9002;
                    break;
                }
                case JTT809Bodies::DOWN_DISCONNECT_REQ: {
                    body = new JTT809_0x9003;
                    break;
                }
                case JTT809Bodies::DOWN_DISCONNECT_RSP: {
                    body = new JTT809_0x9004;
                    break;
                }
                case JTT809Bodies::DOWN_LINKTEST_REQ: {
                    body = new JTT809_0x9005;
                    break;
                }
                case JTT809Bodies::DOWN_LINKTEST_RSP: {
                    body = new JTT809_0x9006;
                    break;
                }
                case JTT809Bodies::DOWN_DISCONNECT_INFORM: {
                    body = new JTT809_0x9007;
                    break;
                }
                case JTT809Bodies::DOWN_CLOSELINK_INFORM: {
                    body = new JTT809_0x9008;
                    break;
                }
                case JTT809Bodies::UP_MANAGE_TOTAL_RECV_BACK_MSG: {
                    body = new JTT809_0x9101;
                    break;
                }
                case JTT809Bodies::DOWN_MANAGE_MSG_REQ: {
                    body = new JTT809_0x9102;
                    break;
                }
                case JTT809Bodies::UP_MANEGE_MSG_RSP: {
                    body = new JTT809_0x1102;
                    break;
                }
                case JTT809Bodies::DOWN_MANAGE_MSG_SN_INFORM: {
                    body = new JTT809_0x9103;
                    break;
                }
                case JTT809Bodies::UP_MANAGE_MSG_SN_INFORM: {
                    body = new JTT809_0x1103;
                    break;
                }
                case JTT809Bodies::UP_EXG_MSG: {
                    body = new JTT809_0x1200;
                    break;
                }
                case JTT809Bodies::DOWN_EXG_MSG: {
                    body = new JTT809_0x9200;
                    break;
                }
                case JTT809Bodies::UP_PLATFORM_MSG: {
                    body = new JTT809_0x1300;
                    break;
                }
                case JTT809Bodies::DOWN_PLATFORM_MSG: {
                    body = new JTT809_0x9300;
                    break;
                }
                case JTT809Bodies::UP_WARN_MSG: {
                    body = new JTT809_0x1400;
                    break;
                }
                case JTT809Bodies::DOWN_WARN_MSG: {
                    body = new JTT809_0x9400;
                    break;
                }
                case JTT809Bodies::UP_CTRL_MSG: {
                    body = new JTT809_0x1500;
                    break;
                }
                case JTT809Bodies::DOWN_CTRL_MSG: {
                    body = new JTT809_0x1500;
                    break;
                }
                case JTT809Bodies::UP_BASE_MSG: {
                    body = new JTT809_0x1600;
                    break;
                }
                case JTT809Bodies::DOWN_BASE_MSG: {
                    body = new JTT809_0x9600;
                    break;
                }
                default: break;
            }

            return body;
        }
    };
}

#endif //MESSAGE_BODY_FACTORY_H
